var e = require;
var t = module;
var o = exports;
var n;
Object.defineProperty(o, "__esModule", {value: !0});
var r = e("NativeAdComponent"),
    s = e("SDK"),
    c = e("VivoAd"),
    l = e("AdUtils"),
    d = cc._decorator,
    u = d.ccclass,
    p =
        (d.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (t._iconList = []), t;
            }
            return (
                __extends(t, e),
                (t.prototype.init = function (e) {
                    (this._config = e), l.default.instance.log("创建Icon广告");
                }),
                (t.prototype.showIconAd = function (e, t, o) {
                    void 0 === e && (e = 0);
                    var n = this;
                    if (null != this._config && 1 == this._config.enable && 1 == this._config.icon_ad_enable) {
                        var i = c.default.Instance.getVivoNativeData();
                        if (null != i && i.isReady()) {
                            var a = function () {
                                    c.default.Instance.creatorNativeData(),
                                        s.default.Instance.reportLog(s.NodeAction.NATIVE_CLICK, "原生icon点击");
                                },
                                d = function () {
                                    c.default.Instance.creatorNativeData(),
                                        s.default.Instance.reportLog(s.NodeAction.NATIVE_SHOW, "原生icon展示");
                                },
                                u = function () {
                                    s.default.Instance.reportLog(s.NodeAction.NATIVE_CLOSE, "原生icon关闭");
                                },
                                p = cc.director.getScene().children[0],
                                h = p.getChildByName("iconAd");
                            h && h.removeFromParent(),
                                l.default.instance.loadPrefabs("sdk/res/prefabs/NativeIconAd", function (e) {
                                    var s = cc.instantiate(e);
                                    (n._nativeIconAd = s.addComponent(r.default)),
                                        n._nativeIconAd.initData(i),
                                        n._nativeIconAd.listionCall(d, a, u),
                                        p.addChild(s, 1e3, "icon"),
                                        n._nativeIconAd.showAd(r.NativeType.ICON, n._config, t, o);
                                });
                        } else l.default.instance.log("---------showNativeIconAd 广告数据不存在-----");
                    }
                }),
                (t.prototype.hideIcon = function () {
                    this._nativeIconAd && this._nativeIconAd.hide();
                }),
                __decorate([u], t)
            );
        })(cc.Component));
o.default = p;
